package it.duecaffe.claysoftware.interventi.client.handler;

import it.duecaffe.claysoftware.interventi.shared.models.MenuModel;

import com.google.gwt.event.shared.GwtEvent;

public class MenuEvent extends GwtEvent<ClayEventHandler> {
	
	private MenuModel menu;
	
	public static Type<ClayEventHandler> TYPE = new Type<ClayEventHandler>();
	
	public MenuEvent(MenuModel menu) {
		this.menu = menu;
	}

	@Override
	public Type<ClayEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(ClayEventHandler handler) {
		handler.onMenuSelection(this);
	}
	
	public MenuModel getMenu() {
		return menu;
	}
}
